Question: I am facing a peculiar problem in redirecting after `Session.Abandon`, here is the code snippet 

```
if (Session["Login"] != null)
            {
                login = (LoginState)Session["Login"];
                if (!RoleValidation.ManagerRoleValidate(login.role_id))
                {
                    Session.Remove("Login");
                    Session.RemoveAll();
                    Session.Abandon();                       
                    Response.Redirect("~/Login.aspx");

                }
            }

```

here if the condition is true it takes ages to redirect ... and actually it doesnt redirect to the page at all as if it seems its stuck somewhere ... have put this section into try catch block it says as 

```
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

```

I am not sure what's causing it. What is the reason why it's happening?

The complete code snippet is : 

```
     protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["Login"] != null)
        {
            login = (LoginState)Session["Login"];
            if (!RoleValidation.ManagerRoleValidate(login.role_id))
            {
                Session.Remove("Login");
                Session.RemoveAll();
                Session.Abandon();
                Response.Redirect("~/Login.aspx", false);

            }
        }
        else
        {
            Response.Redirect("~/Login.aspx");
        }

    }
public static Boolean ManagerRoleValidate(String Role_id) 
{
    if (Role_id.Equals("1") || Role_id.Equals("2") || Role_id.Equals("4") || Role_id.Equals("999"))
    {
        return true;
    }
    else
    {
        return false;

    }
}

```

and there are no redirects in the Login.aspx so that it can redirect again and again.

Answer: 
At first, I would recommend two free online sources about Mercurial: [hginit](http://hginit.com)
and the book [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/). 

Now, to your questions.

I'll start with the third. Yes, it is possible to attach names to revisions, they are called tags.

To commit your existing versions into a linear history in one repository do the following:

```
mkdir myNewRepo
cd myNewRepo
hg init

```

Now you have a new repository. For every company directory repeat the following steps in order to copy your files into the repository, make them known to hg, commit them and tag that new revision with a name. 

```
cp ../oldVersionA/* .
hg add letter.tex resume.tex diploma.pdf
hg commit -m "Job application to A Inc."
hg tag companyA

```

Note, that you only have to add every file path once to a repository.
**[My favorite Mercurial tutorial here by Joel Spolsky](http://hginit.com/)**

![enter image description here](https://i.stack.imgur.com/kyL0s.png)You can try using GUI tools for Mac OS, such as [Murky](https://bitbucket.org/snej/murky/wiki/Home) or [MacHg](http://jasonfharris.com/machg/).

These will help you to get started.

Since all you want is to track linear history of your modifications, working with Mercurial in console can be cumbersome for you. GUI tools usually hide arcane options and show only a simpler subset of operations available.

UPDATE:
Mercurial also has a repository and a working directory. The difference is that Mercurial's repository is stored locally, all of it. There is no 'central server' part. All the history, tags, branches is stored in .hg directory in your project. The working directory is just a snapshot of a given revision. For example your repository history has 99 commits. The working directory code can be updated to correspond to, say, 50 commit, or 98 commit. So you 'fast-forward' or 'rewind' the working directory by specifying the commit number (or hash).